package com.wzg.pldroidplayer.recyclerviewdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Toast;

import com.pili.pldroid.player.widget.PLVideoView;
import com.wzg.pldroidplayer.recyclerviewdemo.R;
import com.wzg.pldroidplayer.recyclerviewdemo.widget.MediaController;

public class VideoPlayerPalyer extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_video_player_palyer);

        Bundle bundle = getIntent().getExtras();
        String videoUrl = bundle.getString("VideoUri");
        Toast.makeText(this, videoUrl, Toast.LENGTH_SHORT).show();

        PLVideoView mVideoView = (PLVideoView) findViewById(R.id.PLVideoView);
        MediaController mMediaController = new MediaController(this);
        mVideoView.setMediaController(mMediaController);

//        mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_PAVED_PARENT);
        mVideoView.setDisplayAspectRatio(PLVideoView.ASPECT_RATIO_FIT_PARENT);
//这里输入视屏地址
        mVideoView.setVideoPath(videoUrl);
        mVideoView.start();
    }
}
